<template>
  <div>
    <h2>居民投诉统计</h2>
    <div id="chart-three" class="three"></div>
  </div>
</template>

<script setup>
import { inject, onMounted, reactive } from "vue";
import link from "@/api/link.js";
import apiUrl from "@/api/url.js";
let $echarts = inject("echarts");

onMounted(() => {
  let myChart = $echarts.init(document.getElementById("chart-three"));

  link(apiUrl.chartDataIII).then((resolve) => {
    console.log(resolve);

    myChart.setOption({
      legend: { top: "bottom" },
      tooltip: {},
      series: [
        {
          type: "pie",
          data: resolve.data,
          radius: [10, 100],
          center: ["50%", "45%"],
          roseType: "area",
        },
      ],
    });
  });
});
</script>

<style scoped lang="scss">
h2 {
  height: 0.35rem;
  color: #fff;
  line-height: 0.35rem;
  text-align: center;
  font-size: 0.25rem;
}
.three {
  height: 5.6rem;
}
</style>
